package com.dodoke.controller;

import com.dodoke.entity.RetailRoute;
import com.dodoke.service.IRetailRouteService;
import com.dodoke.utils.AjaxResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 线路管理控制层
 */
@Slf4j
@RestController
@RequestMapping("/retail/route")
public class RetailRouteController {
    @Autowired
    private IRetailRouteService retailRouteService;

    /**
     * 线路管理分页请求接口
     *
     * @param currentPage 当前页码
     * @param pageSize    每页显示数量
     * @param retailRoute 模糊查询条件
     * @return
     */
    @GetMapping("/{currentPage}/{pageSize}")
    public AjaxResult getListByPage(@PathVariable Integer currentPage, @PathVariable Integer pageSize, RetailRoute retailRoute) {
        return AjaxResult.success("线路管理列表请求成功", retailRouteService.getListByPage(currentPage, pageSize, retailRoute));
    }
}
